#include <stdio.h>

int main(int argc, char *argv[]) 
{
	long findf(int n),m;
	int n;
	scanf("%d",&n);
	m=findf(n);
	printf("%ld\n",m);
}
long findf(int n)
{
	if(n<=0)return 1;
	if(n>0)return n*findf(n-1)+findf(n-2);
}